﻿<template>
  <!-- 编辑页面参数的弹窗 -->
  <el-dialog v-drag :title = 'dialogTitle' :visible.sync = 'dialogFormVisible' width = '95%' class = 'settingsDialog' :close-on-click-modal = "false" :close-on-press-escape = "false" @close = "resetForm">
    <V-Settings :currentRow = 'currentRow' :showEditContentDialog = 'dialogFormVisible' from = 'dynamic' @resetForm = 'resetForm' @submitForm = 'submitForm'></V-Settings>
  </el-dialog>
</template>

<script>
import VSettings from '@/components/DynamicFormComponents/DynamicForm.vue'
export default {
  props: ['showSettingsDialog', 'currentRow'],
  data () {
    return {
      dialogTitle: '设置页面参数',
      dialogFormVisible: false
    }
  },
  methods: {
    resetForm () {
      this.$emit('giveUp')
    },
    submitForm (fromSettings) {
      this.$emit('sureEditSetting', fromSettings)
    }
  },
  components: {
    VSettings
  },
  watch: {
    showSettingsDialog: {
      handler: function (val, oldVal) {
        this.dialogFormVisible = val
      },
      deep: true
    }
  }
}
</script>
